#include <vector>

#include "include/LoadBordersVisitor.h"
#include "include/Monde.h"
#include "include/Continent.h"
#include "include/Territoire.h"

using namespace std;

void LoadBordersVisitor::visit(Territoire * _territoire)
{
   Territoire* territoireBorder;
   vector<string*>::const_iterator borders_ite;
   for(borders_ite = _territoire->getBordersName()->begin();
       borders_ite != _territoire->getBordersName()->end();
       borders_ite++)
   {
      territoireBorder = _territoire->getContinent()->getMonde()->getTerritoireByName( (*borders_ite)->c_str() );
      _territoire->addBorderById( territoireBorder->getId() );
   }
}
